package com.wangsd.web.sys.mapper;

import com.wangsd.web.sys.entity.SysMenu;
import com.wangsd.web.sys.entity.SysPermission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author generator
 * @since 2019-09-02
 */
public interface SysPermissionMapper extends BaseMapper<SysPermission> {

    @Select("SELECT t.*,t2.menu_id FROM sys_permission t left join sys_button t2 on t.access_id = t2.id" +
            " where t.access_type = 2 and t.role_id = #{roleId}")
    List<SysPermission> selectByRoleId(Long roleId);
}
